Patch from Paul Davis, only flush the toplevel once per update.
authorRichard Hult <richard@imendio.com>
Fri, 14 Mar 2008 10:20:55 +0000 (10:20 +0000)
committerRichard Hult <rhult@src.gnome.org>
Fri, 14 Mar 2008 10:20:55 +0000 (10:20 +0000)
2008-03-14  Richard Hult  <richard@imendio.com>

* gdk/quartz/gdkwindow-quartz.c:
(gdk_window_quartz_process_all_updates): Patch from Paul Davis,
only flush the toplevel once per update.

svn path=/trunk/; revision=19871

ChangeLog
gdk/quartz/gdkwindow-quartz.c

index 1d80d6eb0976c4585b0e150a1e15924df9f827eb..94ea7b228c3b7e01012c5347ef2913b4601de753 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-03-14  Richard Hult  <richard@imendio.com>
+
+       * gdk/quartz/gdkwindow-quartz.c:
+       (gdk_window_quartz_process_all_updates): Patch from Paul Davis,
+       only flush the toplevel once per update.
+
 2008-03-13  Federico Mena Quintero  <federico@novell.com>
 
        * gtk/gtkfilechooserentry.c (create_completion_feedback_window):
index ed385aa4bb5779e9403ed47326aa59708b5f2c55..b72097e940413da78aaa1fd2187d4eaac8b64702 100644 (file)
@@ -333,9 +333,11 @@ gdk_window_quartz_process_all_updates (void)
 {
   GSList *old_update_windows = update_windows;
   GSList *tmp_list = update_windows;
+  GSList *nswindows;
 
   update_idle = 0;
   update_windows = NULL;
+  nswindows = NULL;
 
   g_slist_foreach (old_update_windows, (GFunc) g_object_ref, NULL);
   
@@ -343,15 +345,43 @@ gdk_window_quartz_process_all_updates (void)
 
   while (tmp_list)
     {
+      GdkWindow *window = tmp_list->data;
+      GdkWindow *toplevel;
+      NSWindow *nswindow;
+      GdkWindowObject *private;
+      GdkWindowImplQuartz *impl;
+
+      toplevel = gdk_window_get_toplevel (window);
+      private = (GdkWindowObject *) toplevel;
+      impl = (GdkWindowImplQuartz *) private->impl;
+      nswindow = impl->toplevel;
+
+      if (nswindow && ![nswindow isFlushWindowDisabled]) 
+        {
+          [nswindow disableFlushWindow];
+          nswindows = g_slist_prepend (nswindows, nswindow);
+        }
+
       gdk_window_quartz_process_updates_internal (tmp_list->data);
 
       g_object_unref (tmp_list->data);
       tmp_list = tmp_list->next;
     }
 
+  while (nswindows) 
+    {
+      NSWindow *nswindow = nswindows->data;
+
+      [nswindow enableFlushWindow];
+      [nswindow flushWindow];
+
+      nswindows = nswindows->next;
+    }
+                   
   GDK_QUARTZ_RELEASE_POOL;
 
   g_slist_free (old_update_windows);
+  g_slist_free (nswindows);
 }
 
 static gboolean